<template>
	<view>
		<view class="u-content">
			<u-parse :html="content" :show-with-animation="true" :lazy-load="true" :domain="domain"></u-parse>
		</view>
	</view>
</template>

<script>
	import { baseUrl } from '@/common/http';
	export default {
		data() {
			return {
				domain: baseUrl,
				id: '',
				content: ''
			}
		},
		onLoad(option) {
			this.id = option.id;
			uni.setNavigationBarTitle({
				title: option.title
			});
			this.init()
		},
		methods: {
			init() {
				this.$http('/api/article/detail', {
					id: this.id
				}).then(data => {
					uni.setNavigationBarTitle({
						title: data.title
					});
					this.content = data.content;
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.u-content {
		padding: 24rpx;
		font-size: 32rpx;
		color: $u-content-color;
		line-height: 1.6;
	}
</style>
